﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Xml;
using OgilvyOne.Model;

namespace OgilvyOne.BLL
{
    /// <summary>
    /// 栏目标签,获取指定栏目属性值
    /// <cms:menu value="属性名" id="栏目ID"></cms:menu>
    /// </summary>
    class LabelMenuLabel : LabelCommonLabel
    {
        private MenuLabel ml;
        public LabelMenuLabel(CommonModel model)
            : base(model)
        {
            ml = new MenuLabel(model);
        }



        public override string GetLabelLabelHtml()
        {
            ml.LabelStr = LabelStr;

            XmlDocument doc = GetLabelValueXmlDocument(GetLabelValue());

            ml.Cid = int.Parse(doc.SelectSingleNode("//cid").Value);
            ml.MethodName = doc.SelectSingleNode("//method").Value;
            return ml.GetLabelHtml();
        }
    }
}
